// 放置全局指令

import store from '@/store'

// Vue.directive('checkBtn', {
//   inserted(el, binding) {
//     // console.log(el, binding.expression)
//     const points = store.state.user.userInfo.roles.points
//     console.log(points)
//     if (!points.includes(binding.expression)) {
//       el.remove()
//     }
//   }
// })

const dirs = {
  install(Vue) {
    Vue.directive('checkBtn', {
      inserted(el, binding) {
        // console.log(el, binding)
        const points = store.state.user.userInfo.roles.points
        console.log(points)
        if (!points.includes(binding.value)) {
          el.remove()
        }
      }
    })
  }
}

export default dirs
